package com.flython.aems.management.component;

import com.flython.aems.management.model.base.FinalParamPoJo;
import lombok.AllArgsConstructor;

import java.util.List;
import java.util.Map;


/**
 * 通过supplier来操作params条项，批量的参数插入、修改等逻辑，请实例化supplier后实现
 * @param <E>
 */
@AllArgsConstructor
public abstract class AbstractParamsSupplier<E>{

    /**
     * 越大优先度越高，priority值高的会覆盖priority低来源的参数
     */
    private int priority = 0;

    public abstract Map<String,E> selectByNeId(Long neId);

    public void deleteSingleParam(Long neId,String name){
        // impl in subClass
    };

    public void updateOrAddParams(Long neId, List<FinalParamPoJo> paramPoJos){
        // impl in subClass
    };


    public int getPriority() {
        return priority;
    }
}
